/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:46 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class TacvuEntity
    {
        public TacvuEntity()
        {
			m_pk_itacvuid=0;
			m_stentacvu="";
			m_skyhieu="";
			m_sghichu="";
        }
		private Int32 m_pk_itacvuid;
		public Int32 PK_iTacvuID
		{
			get { return m_pk_itacvuid ; }
			set { m_pk_itacvuid = value; }
		}
		private String m_stentacvu;
		public String sTentacvu
		{
			get { return m_stentacvu ; }
			set { m_stentacvu = value; }
		}
		private String m_skyhieu;
		public String sKyhieu
		{
			get { return m_skyhieu ; }
			set { m_skyhieu = value; }
		}
		private String m_sghichu;
		public String sGhichu
		{
			get { return m_sghichu ; }
			set { m_sghichu = value; }
		}

        #region Comparison
        public static List<TacvuEntity> Sort(List<TacvuEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(TacvuEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<TacvuEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<TacvuEntity> COMPARISON_PK_iTacvuID
		{
			get
			{
				return delegate(TacvuEntity entity,TacvuEntity other)
				{
					return entity.PK_iTacvuID.CompareTo(other.PK_iTacvuID);
				};
			}
		}
		public static Comparison<TacvuEntity> COMPARISON_sTentacvu
		{
			get
			{
				return delegate(TacvuEntity entity,TacvuEntity other)
				{
					return entity.sTentacvu.CompareTo(other.sTentacvu);
				};
			}
		}
		public static Comparison<TacvuEntity> COMPARISON_sKyhieu
		{
			get
			{
				return delegate(TacvuEntity entity,TacvuEntity other)
				{
					return entity.sKyhieu.CompareTo(other.sKyhieu);
				};
			}
		}
		public static Comparison<TacvuEntity> COMPARISON_sGhichu
		{
			get
			{
				return delegate(TacvuEntity entity,TacvuEntity other)
				{
					return entity.sGhichu.CompareTo(other.sGhichu);
				};
			}
		}
        #endregion
    }
}
